<?php
namespace Goatherd\Content\Engine\Reader;

/**
 * IReaderMapper does describe a (persistent) caching interface for reader
 * resources (IResource).
 *
 * Identifier type is abstract and can depend on actual source and reader.
 * An IReaderMapper might further restrict IResource to a specific interface.
 *
 * @category ContentEngine
 * @package Goatherd\Content\Engine
 * @subpackage Reader
 */
interface IReaderMapper
{
    /**
     *
     * @param mixed $identifier
     * @return bool
     */
    public function hasResource($identifier);

    /**
     *
     * @param mixed $identifier
     * @return IResource NULL if resource does not exist
     */
    public function getResource($identifier);

    /**
     *
     * @param mixed $identifier
     * @param IResource $data
     */
    public function setResource($identifier, IResource $data);
}